import { ApiProperty } from '@nestjs/swagger'
import { IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator'
import { NoticeEnum } from 'src/types/notice'
export class CreateNoticeDto {
  @ApiProperty({ description: '公告标题', example: '公告标题' })
  @IsString({ message: '公告标题必须为字符串' })
  @IsNotEmpty({ message: '公告标题不能为空' })
  @MaxLength(20, { message: '公告标题最长为20个字符' })
  title: string
  @ApiProperty({ description: '公告内容', example: '公告内容' })
  @IsString({ message: '公告内容必须为字符串' })
  @IsNotEmpty({ message: '公告内容不能为空' })
  content: string
  @ApiProperty({ description: '管理员ID', example: 1 })
  @IsNotEmpty({ message: '管理员ID不能为空' })
  adminId: number
  @ApiProperty({ description: '公告状态', example: '0' })
  @IsOptional()
  status?: NoticeEnum
}
